package net.istore.market.service.order;
 
import net.istore.market.dao.order.OrderDao;
import net.istore.market.domain.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
 
    @Autowired
    private OrderDao orderDAO;

    @Transactional
    public Order addOrder(Order order) {
        return orderDAO.addOrder(order);
    }

    @Transactional
    public List<Order> getOrders() {
        return orderDAO.getOrders();
    }

    @Transactional
    public Order getOrder(long orderId) {
        return orderDAO.getOrder(orderId);
    }

    @Transactional
    public Order removeOrder(long id) {
        return orderDAO.removeOrder(id);
    }
}
